package com.atguigu07.object.equals.exer1;

import java.util.Objects;

/**
 * ClassName: Order
 * Package: com.atguigu07.object.equals.exer1
 * Description:
 *
 * @Author xiao_qi
 * @Create 2024/9/2 16:04
 * @Version 1.0
 */
public class Order {
    private int orderID;
    private String orderName;
    public void setOrderID(int id){
        this.orderID = id;
    }
    public void setOrderName(String Name){
        this.orderName = Name;
    }
    public int getOrderID(){
        return orderID;
    }
    public String getOrderName(){
        return orderName;
    }
    public Order(String orderName,int orderID){
        this.orderName = orderName;
        this.orderID = orderID;
    }

    //手写

    public boolean equals(Object obj){
        if(this == obj){ return true;}
        if(obj instanceof Order){
            Order order = (Order) obj;
            return this.orderID == order.orderID && this.orderName.equals(order.orderName);
        }
        return false;
    }


}
